// 在scss中如果文件是被包含的,前面有下划线，引入时不用加下划线
@import './variables';
*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
}
html {
  font-size: 13px;
}
body{
  font-family: Arial, Helvetica, sans-serif;
  color: #333;
  background: #F1F1F1;
  -webkit-font-smoothing: antialiased;
}
p {
  line-height: 1.5;
  color: #000;
}
a{
  color: #222;
  text-decoration: none;
}
h3 {
  font-weight: normal;
}

ul,li{
  list-style: none;
}

// colors
@each $colorKey,$color in $colors {
  .text-#{$colorKey} {
    color: $color
  }
  .bg-#{$colorKey} {
    background-color: $color;
  }
}

// text-align
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var !important;
  }
}

// overflow hidden
.text-hidden{
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
} 
// font-size
@each $sizeKey,$size in $font-sizes {
  .fs-#{$sizeKey} {
    font-size: $size * $base-font-size;
  }
}

// font-weight
.fw-bold{
  font-weight: bold;
}

// flex
.d-flex{
  display: flex;
}
.flex-column{
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.flex-1{
  flex: 1;
}
.flex-grow-1{
  flex-grow: 1;
}


@each $key,$val in $flex-jc {
    .jc-#{$key} {
      justify-content: $val;
    }
}

@each $key,$val in $flex-ai {
  .ai-#{$key} {
    align-items: $val;
  }
}


// margin padding
@each $typeKey,$type in $spaceing-types {  

  @each $dirKey,$dir in $spaceing-directions {
    @each $sizeKey,$size in $spaceing-size {
      // .m-0 {margin:0}
      .#{$typeKey}-#{$sizeKey} {
        #{$type}: $size * $spaceing-base-size;
      }
      // .mx-0{ margin-left:0; margin-right:0 }
      .#{$typeKey}x-#{$sizeKey} {
        #{$type}-left: $size * $spaceing-base-size;;
        #{$type}-right: $size * $spaceing-base-size;;
      }
     .#{$typeKey}y-#{$sizeKey} {
        #{$type}-top: $size * $spaceing-base-size;;
        #{$type}-bottom: $size * $spaceing-base-size;;
      }
      // .mt-0{ margin-top: .7692rem }
      .#{$typeKey}#{$dirKey}-#{$sizeKey} {
        #{$type}-#{$dir}: $size * $spaceing-base-size;
      }
      
    }
  }
}

.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

// btn
.btn {
  // width: 4.6154rem;
  // height: 1.8462rem;
  padding: .3077rem .3846rem;
  border: 0;
  border-radius: .1538rem;
  font-size: map-get($font-sizes, 'sm') * $base-font-size;
  &.btn-lg {
    i {
      color: map-get($colors, 'primary');
      font-weight: bold;
      font-size: 1.4rem;
    }
    background: map-get($colors, 'grey4');
    border: 1px solid $border-color;
    padding: .5769rem .6154rem;
    font-size: 1.1rem;
  }
};

// sprite 精灵图
.sprite {
  background: url(../index.png) no-repeat 0 0;
  background-size: 28.8462rem;
  display: inline-block;
  &.sprite-logo {
    background-position:  0 72.588%;;
    width: 2.3077rem;
    height: 2.3077rem;
  }
  &.sprite-news {
    background-position: 63.546% 15.517%;
    width: 1.7692rem;
    height: 1.5385rem;
  }
  &.sprite-gsz {
    background-position: 90.483% 15.614%;
    width: 1.7692rem;
    height: 1.5385rem;
  }
  &.sprite-arrow {
    background-position: 38.577% 52.076%;
    width: .7692rem;
    height: .7692rem;
  }
}

// nav
::-webkit-scrollbar{ display: none };
.nav {
  display: flex;
  // justify-content: space-between;
  width: 100%;
  // height: 1.8462rem;
  overflow: auto;
  .nav-item {
    display: flex;
    justify-content: start;
    align-items: center;
    // margin-right: 3.5385rem;
    flex-shrink: 0;
    border-bottom: 3px solid rgba($color: #fff, $alpha: 0);
    &.active {
      color: map-get($colors, 'primary');
      border-bottom: 3px solid map-get($colors, 'primary');
    }
  }
  & .nav-item:last-child  {
    margin-right: 0;
  }

  // 顶部导航
  &.nav-inverse{
    .nav-item {
      justify-content: center;
      margin-right: 0;
      flex-shrink: 0;
      padding: 0 1.5385rem;
      .nav-link {
        color: map-get($colors, 'white');
        &.active {
          border-bottom: 3px solid map-get($colors, 'white');
        }
      }
    }
  }
}

// border
@each $dir in (top, right, bottom, right) {
  .border-#{$dir} {
    border-#{$dir}: 1px solid map-get($colors, 'grey3');
  }
}
